<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:zj="http://www.zju.edu.cn" exclude-result-prefixes="zj">
  <xsl:import href="../Tk2Base/Utility.xslt"/>
  <xsl:import href="../Tk2Base/GlobalVariable.xslt"/>
  <xsl:import href="../Tk2Base/Button.xslt"/>
  <xsl:param name="Doc"/>
  <xsl:param name="IsPost"/>
  <xsl:output method="html" indent="yes"/>
  <xsl:variable name="zj:Toolkit" select="/Toolkit"/>
  <xsl:variable name="zj:XmlData" select="$Doc"/>
  <xsl:variable name="zj:PageX" select="$zj:Toolkit/Info/PageX"/>
  <xsl:template match="/">
    <html>
      <head>
        <title></title>
        <link rel="stylesheet" type="text/css" href="../css/style.css"/>
        <link rel="stylesheet" type="text/css" href="../themes/default/easyui.css"/>
        <link rel="stylesheet" type="text/css" href="../themes/icon.css"/>
        <script language="JavaScript" src="../js/jquery-1.7.1.min.js"></script>
        <script language="JavaScript" src="../js/jquery.easyui.min.js"></script>
        <script language="JavaScript" src="../js/common.js"></script>
        <script>
          <xsl:comment>
            <![CDATA[    
           ///////////////////////////////////////////////////////////////////////////////////////////////////////////
          $(function() {
          
           var tagTree = '#deeptree';
            $(tagTree).tree({
                method: 'get',
                url: "../Pages/TreeJsonPage.zjx?Source="+Source,
                onClick: function(node) {             
                    ShowDetail(node.id, node.text);
                }
            });
            
          function ShowDetail(id, text)
          {
            var url = "../Pages/WebDetailXmlPage." + PageX + "?Source=" + Source+"&PID="+id+"&ID="+id;
           
            var content = XmlHttpGet(url);
            var tabID = "easywebTabsDiv";
            addTab(tabID, text, content);
          }
    
    function addTab(tabID, title, content){  
        if ($('#' + tabID).tabs('exists', title)){  
            $('#' + tabID).tabs('select', title);  
        } else {       
            $('#' + tabID).tabs('add',{  
                title:title,  
                content:content,  
                closable:true  
            });  
        }  
    }  
    
});         
          ]]>
          </xsl:comment>
        </script>
      </head>
      <body  class="easyui-layout">

        <div id="floatDiv" style="position: absolute; visibility: hidden; left:0px; top:0px; width:200px; height:90px; z-index:10; overflow: auto; border:solid 1px #003366; background-color: #FFFFEE" class="scrollBar"/>
        <div region="west" split="true" title="List" style="width:280px;padding1:1px;overflow:hidden;">
          <div id ="deeptree" style="padding-top:10px;"></div>
        </div>
        <div region="center"  style="overflow:hidden;">
          <div  id="easywebTabsDiv" class="easyui-tabs" fit="true" border="false">

          </div>
        </div>
        <script>
          var Source = '<xsl:value-of select="$zj:Source"/>';
          var PageX = '<xsl:value-of select="$zj:PageX"/>';
          var pID ;
          var QueryStringID = "<xsl:value-of select="$zj:Toolkit/QueryString/PID"/>";
          var retURL = "&amp;RetURL=../Pages/WebDetailXmlPage." + PageX + "%3fSource=" + Source+"%26ID=";

          var tabID = "easywebTabsDiv";

          function EditTree() {

          var tab = $('#' + tabID).tabs('getSelected');
          var id = $('#FN_ID',tab).val();

          var url = "../Pages/WebUpdateXmlPage." + PageX + "?Source=" + Source + "&amp;ID=" + id;

          var href = url + retURL + id;

          $('#' + tabID).tabs('update',{
          tab: tab,
          options:{
          cache:false,
          href:href
          }
          });

          }

          function CloseTab() {
          var pp = $('#' + tabID).tabs('getSelected');
          var tab = pp.panel('options');
          $('#' + tabID).tabs('close',tab.title);
          }

        </script>
      </body>
    </html>
  </xsl:template>
  <xsl:template name="zj:PageTitle">
    <xsl:call-template name="zj:LittleTitle">
      <xsl:with-param name="Name" select="concat('浏览', $zj:Title)"/>
    </xsl:call-template>
  </xsl:template>
</xsl:stylesheet>
